
Loading_Animation_Frame .equ appbackupscreen + 750

Load_Game:
 SET fracDrawLFont, (IY + fontFlags)
 B_CALL _GrBufClr
 B_CALL fastCopy
 LD HL, $C001
 LD (Loading_Animation_Frame), HL

 LD A, 4
 LD (Sprite_Width), A


 DrawSmallText(27,10, Loading_Text)


Continue_Animation:

 CALL Increase_Animation_Frame
 
 LD A, 32
 
 LD IX, Reclauda_Loading_Animation
 LD HL, (Loading_Animation_Frame)
 LD D, L
 LD E, H
 LD B, 28
 ADD IX, DE
 LD L, 30
 CALL Put_Sprite_Overwrite
 LD BC, 255*256
Decrease_Timer:
 LD A, C
 SUB 1
 CP 0
 JR Z, DJNZ_B
 LD C, A
 JR Decrease_Timer

DJNZ_B: 
 LD C, 255
 DJNZ Decrease_Timer
 call fastCopyWithoutClear







 B_CALL _GetCSC
 OR A
 JR Z, Continue_Animation
 RET

Increase_Animation_Frame:

 LD HL, (Loading_Animation_Frame)
 LD D, 28*4
 LD E, 0
 ADD HL, DE
 LD A, H
 CP $50
 CALL Z, Increase_L
 CP $30
 JR Z, Reset_Loading_Frame_Animation
 LD (Loading_Animation_Frame), HL
 RET

Reset_Loading_Frame_Animation:

 LD H,0
 LD L, 0
 LD (Loading_Animation_Frame), HL
 RET

Increase_L:
 
 INC HL
 RET

Loading_Text:

 .db "LOADING",0